/**
@author		jong min, lee
@date		  02/10/2014
@breif		study view controller

copyright(c) tae young soft. all right reserved. 2014
*/
#pragma once

#include <vector>
#include "Taurus_Util/Macros.h"

//forward declarations
class CStudyView;
class CMonitorWnd;

/**
@brief		study view controller
*/
class CStudyViewController
{
private:
  DISALLOW_COPY_AND_ASSIGN(CStudyViewController);

/************************************************************************/
/* public member functions                                              */
/************************************************************************/
public:
  /**
  @brief		default constructor
  */
  CStudyViewController();

  /**
  @brief		destructor
  */
  ~CStudyViewController();

  /**
  @brief		attach monitor windows to study views
  @param		monitorWnds pointer to monitor windows to be attached
  @param    workAreas pointer to work areas
  @param    numOfMonitors the number of monitors
  @param    redraw flag indicating study views are to be redrawn
  @return		ERROR_SUCCESS if succeeds, an error code otherwise
  */
  DWORD attachMonitors(const CMonitorWnd** monitorWnds,
                       const CRect* workRects,
                       const unsigned int numOfMonitors,
                       BOOL redraw);

  /**
  @brief		detach monitors from study views
  @param		redraw flag indicating study views to be redrawn
  */
  void detachMonitors(BOOL redraw);

  /**
  @brief		check whether study view controller attach monitor to study views
  @return		TRUE if attach monitor to study views, FALSE if not
  */
  BOOL doesAttachMonitors() const;

  /**
  @brief		check whether study view controller attaches given monitor window
  @param		monitorWnd monitor window
  @return		TRUE if study view controller attaches given monitor window, FALSE if not
  */
  BOOL doesAttachMonitor(const CMonitorWnd& monitorWnd) const;

  /**
  @brief		change position and dimensions of a study view attaches to speicifed monitor window
  @param		monitorwind pointer to monitor window
  @param    rect new position
  @param    redraw flag indicating whether study view is to be repanted
  @return		ERROR_SUCCESS if succeeds, an error code otherwise
  */
  DWORD MoviewStudyView(const CMonitorWnd* monitorWnd,
                        const CRect& rect,
                        BOOL bRedraw);
  /**
  @brief		set title bar background and text color
  @param		bkClr background color
  @param    bkText text color
  @param    redraw flag indicating title bar is to be redrawn
  */
  void setTitlebarColor(const COLORREF& bkClr, const COLORREF& textClr, BOOL redraw);

/************************************************************************/
/* private member functions                                             */
/************************************************************************/
private:
  /**
  @brief		destroy all study views
  */
  void destroyAllStudyView();

/************************************************************************/
/* data members                                                         */
/************************************************************************/
private:
  //study views
  std::vector<CStudyView*> m_theStudyViews;
};
  